<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>专家审核</title>
    <%@ include file="../../../common/meta.jsp" %>
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/jquery.ajaxfileupload-2.1.js"></script>
    <script src="${ctx}/js/imageview/jquery.photo.gallery.js?t=${now}"></script>
    <script>
        var oneBasicDoctorInfo = ${oneBasicDoctorInfo};
        var searchInfo = ${searchInfo};
        var imgSrcDefault="${ctx}/images/main/default.jpg";
        var sexMap = '${sexMap}';
        var docProfessionMap = '${docProfessionMap}';
        var mediLevelList = '${mediLevelList}';
        var certificateTypeList = '${certificateTypeList}';
        var type = '${type}';
        var page = '${page}';
    </script>
</head>
<body class="gray-bg">
<div class="myContent">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>${not empty onePfCheckDataLog && onePfCheckDataLog.operateType != 'add'? '编辑' : '新增'}专家信息</h5>
                </div>
                <c:if test="${type == 'info' && page != 1}">
                    <div class="ibox-content">
                        <form class="form-horizontal m-t">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">审核结果：</label>
                                <label class="col-sm-8 control-label control-label-content">${not empty onePfCheckDataLog && onePfCheckDataLog.result == 'pass'? '通过' : '不通过'}</label>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">审核说明：</label>
                                <label class="col-sm-8 control-label control-label-content">${not empty onePfCheckDataLog?onePfCheckDataLog.remark : ''}</label>
                            </div>
                        </form>
                    </div>
                </c:if>
                <div class="ibox-title-2">
                    <h5><i class="fa fa-file-text"></i>  基本信息</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="mainForm" novalidate="novalidate">
                        <input type="hidden" id="checkId" name="checkId" class="form-control" value="${not empty onePfCheckDataLog?onePfCheckDataLog.id : ''}">
                        <input type="hidden" id="id" name="id" class="form-control" value="${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.id : ''}">
                        <input type="hidden" id="docCode" name="docCode" class="form-control" value="${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docCode : ''}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docName != oneBeforeBasicDoctorInfo.docName) ? 'hasChange' : ''}"><span style="color: red">*</span>专家名称：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docName : ''}</label>
                            <div class="col-sm-1 tip"></div>
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docGender != oneBeforeBasicDoctorInfo.docGender) ? 'hasChange' : ''}"><span style="color: red"></span>专家性别：</label>
                            <label class="col-sm-3 control-label control-label-content">
                                <c:forEach items="${sexMap}" var="item">
                                    ${not empty oneBasicDoctorInfo && oneBasicDoctorInfo.docGender == item.key? item.value : '' }
                                </c:forEach>
                            </label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docProfession != oneBeforeBasicDoctorInfo.docProfession) ? 'hasChange' : ''}"><span style="color: red">*</span>专家类型：</label>
                            <label class="col-sm-3 control-label control-label-content">
                                <c:forEach items="${docProfessionMap}" var="item">
                                    ${not empty oneBasicDoctorInfo && oneBasicDoctorInfo.docProfession == item.key? item.value : '' }
                                </c:forEach>
                            </label>
                            <div class="col-sm-1 tip"></div>
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docMediLevel != oneBeforeBasicDoctorInfo.docMediLevel) ? 'hasChange' : ''}"><span style="color: red"></span>专家职称：</label>
                            <label class="col-sm-3 control-label control-label-content">
                                <c:if test="${not empty mediLevelList}">
                                    <c:forEach items="${mediLevelList}" var="item">
                                        ${not empty oneBasicDoctorInfo && oneBasicDoctorInfo.docMediLevel == item.dictCode? item.dictName : '' }
                                    </c:forEach>
                                </c:if>
                            </label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.orgName != oneBeforeBasicDoctorInfo.orgName) ? 'hasChange' : ''}"><span style="color: red">*</span>主执业机构：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.orgName : ''}</label>
                            <div class="col-sm-1 tip"></div>
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docTitle != oneBeforeBasicDoctorInfo.docTitle) ? 'hasChange' : ''}"><span style="color: red"></span>头衔：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docTitle : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.pDeptCode != oneBeforeBasicDoctorInfo.pDeptCode) ? 'hasChange' : ''}"><span style="color: red">*</span>一级科室：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.pDeptName : ''}</label>
                            <div class="col-sm-1 tip"></div>
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.cDeptCode != oneBeforeBasicDoctorInfo.cDeptCode) ? 'hasChange' : ''}"><span style="color: red"></span>二级科室：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.cDeptName : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.sortNum != oneBeforeBasicDoctorInfo.sortNum) ? 'hasChange' : ''}"><span style="color: red"></span>排序：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.sortNum : ''}</label>
                            <div class="col-sm-1 tip"></div>
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.isvName != oneBeforeBasicDoctorInfo.isvName) ? 'hasChange' : ''}"><span style="color: red">*</span>服务商：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.isvName : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.code != oneBeforeBasicDoctorInfo.code) ? 'hasChange' : ''}"><span style="color: red"></span>原专家编码：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.code : ''}</label>
                            <div class="col-sm-1 tip"></div>
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.seniority != oneBeforeBasicDoctorInfo.seniority) ? 'hasChange' : ''}"><span style="color: red"></span>从业年限：</label>
                            <label class="col-sm-3 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.seniority : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docWebsite != oneBeforeBasicDoctorInfo.docWebsite) ? 'hasChange' : ''}"><span style="color: red"></span>主页url：</label>
                            <label class="col-sm-9 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docWebsite : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docAdept != oneBeforeBasicDoctorInfo.docAdept) ? 'hasChange' : ''}"><span style="color: red"></span>擅长：</label>
                            <label class="col-sm-9 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docAdept : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docIntroduction != oneBeforeBasicDoctorInfo.docIntroduction) ? 'hasChange' : ''}"><span style="color: red"></span>个人简介：</label>
                            <label class="col-sm-9 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docIntroduction : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docLogo != oneBeforeBasicDoctorInfo.docLogo) ? 'hasChange' : ''}"><span style="color: red"></span>*头像：</label>
                            <div class="col-sm-8">
                                <img style="float:left;" id="coverUrlImg1" onclick='$.openPhotoGallery(this)' src="${not empty oneBasicDoctorInfo&&not empty oneBasicDoctorInfo.docLogo?oneBasicDoctorInfo.docLogo:ctx.concat('/images/main/default.jpg')}" alt="80*80px，10k以内" class="img-rounded win-img gallery-pic">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docLogo != oneBeforeBasicDoctorInfo.docLogo) ? 'hasChange' : ''}"><span style="color: red"></span>头像url：</label>
                            <label class="col-sm-9 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docLogo : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>

                        <div class="ibox-title-2">
                            <h5><i class="fa fa-file-text"></i>  资质信息</h5>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.docMobile != oneBeforeBasicDoctorInfo.docMobile) ? 'hasChange' : ''}"><span style="color: red"></span>手机号：</label>
                            <label class="col-sm-2 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docMobile : ''}</label>
                            <div class="col-sm-1 tip"></div>
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.identityCard != oneBeforeBasicDoctorInfo.identityCard) ? 'hasChange' : ''}"><span style="color: red"></span>身份证号：</label>
                            <label class="col-sm-2 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.identityCard : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.certificateType != oneBeforeBasicDoctorInfo.certificateType) ? 'hasChange' : ''}"><span style="color: red"></span>证书类型：</label>
                            <label class="col-sm-2 control-label control-label-content">
                                <c:if test="${not empty certificateTypeList}">
                                    <c:forEach items="${certificateTypeList}" var="item">
                                        ${not empty oneBasicDoctorInfo && oneBasicDoctorInfo.certificateType == item.dictCode? item.dictName : '' }
                                    </c:forEach>
                                </c:if>
                            </label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.certificateNo != oneBeforeBasicDoctorInfo.certificateNo) ? 'hasChange' : ''}"><span style="color: red"></span>证书编号：</label>
                            <label class="col-sm-2 control-label control-label-content">${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.certificateNo : ''}</label>
                            <div class="col-sm-1 tip"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ${not empty oneBasicDoctorInfo && not empty onePfCheckDataLog && (onePfCheckDataLog.operateType != 'add' && oneBasicDoctorInfo.certificateMedia != oneBeforeBasicDoctorInfo.certificateMedia) ? 'hasChange' : ''}"><span style="color: red"></span>证书照片（支持上传3张）：</label>
                            <div class="col-sm-10">
                                <img style="float:left;" id="coverUrlImg2" onclick='$.openPhotoGallery(this)' src="${ctx.concat('/images/main/default.jpg')}" alt="60k以内" class="img-rounded win-img gallery-pic">
                                <img style="float:left;margin-left: 20px" id="coverUrlImg3" onclick='$.openPhotoGallery(this)' src="${ctx.concat('/images/main/default.jpg')}" alt="60k以内" class="img-rounded win-img gallery-pic">
                                <img style="float:left;;margin-left: 20px" id="coverUrlImg4" onclick='$.openPhotoGallery(this)' src="${ctx.concat('/images/main/default.jpg')}" alt="60k以内" class="img-rounded win-img gallery-pic">
                            </div>
                        </div>
                        <div class="form-group" id="_btnDiv">
                            <div class="col-sm-4 col-sm-offset-4">
                                <c:if test="${type=='check'}">
                                    <input type="button" class="btn btn-info" id="submitBtn" onclick="checkPass()" value="通过">
                                    <input type="button" class="btn btn-danger" id="submitBtn" onclick="openDoUnPassPage()" value="不通过">
                                </c:if>
                                <input type="button" class="btn btn-white" id="cancelBtn" onclick="doBack()" value="返回">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="mergeModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="_modelTitle" style="text-align: center; font-weight: normal;">合并校验</h4>
            </div>
            <div class="modal-body modal-body-height">
                <form class="form-horizontal m-t">
                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: left; font-size: 16px;">系统检测到【${not empty oneBasicDoctorInfo?oneBasicDoctorInfo.docName : '专家姓名'}】线上有疑似重复数据，是否选择与以下专家合并：</label>
                    </div>
                    <div class="form-group">
                        <div class="ibox-content ibox-content-table">
                            <table class='table table-striped table-hover' data-toggle="table" id="dataTable"
                                   data-pagination="false" data-side-pagination="server" data-striped="true"
                                   data-url="${ctx}/checkDoc/pageFindMergeDocData?t=${now}" data-response-handler="handleServerResult"
                                   data-query-params-type="" data-query-params="getParams"
                            <%--data-height="200"--%>
                                   data-cache="true" data-page-size="${defaultPageSize}" data-page-list="${pageList}">
                                <thead>
                                <tr>
                                    <th data-field="radio" data-radio="true"></th>
                                    <th data-field="docName" data-width="80px" data-align="center">姓名</th>
                                    <th data-field="docLogo" data-width="80px" data-formatter="img" data-align="center">头像</th>
                                    <th data-field="deptName" data-width="80px" data-align="center">科室</th>
                                    <th data-field="orgName" data-width="80px">主执业医院</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: center;"><span style="color: red;">注：选择不合并时，线上可能会出现多条重复数据，请谨慎操作。</span></label>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="doPassMerge()">合并</button>
                <button class="btn btn-primary" onclick="doPassNoMerge()">不合并</button>
                <button class="btn btn-white" onclick="closeMergeModal();">取消</button>
            </div>
        </div>
    </div>
</div>

<div id="unPassModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="_modelTitle2" style="text-align: center; font-weight: normal;">审核不通过</h4>
            </div>
            <div class="modal-body modal-body-height">
                <form class="form-horizontal m-t">
                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: left;"><span style="color: red">*</span>请输入审核不通过原因（必填）：</label>
                    </div>
                    <div class="form-group">
                        <textarea id="reason" name="reason" style="height: 120px; resize: none; width: 100%;" maxlength="1024"></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="doUnPass()">确定</button>
                <button class="btn btn-white" onclick="closeUnPassModal();">取消</button>
            </div>
        </div>
    </div>
</div>

<script src="${ctx}/js/check/doc/win/checkDocMgr.js?t=${now}"></script>
<script src="${ctx}/js/common/upLoadingFileSize.js?t=${now}"></script>
</body>
</html>
